document.addEventListener("DOMContentLoaded", function () {
  // 执行请求获取图片数据
  for (let i = 1; i <= 10; i++) {
    axios
      .get(`http://localhost:8080/goodProject/detail?id=${i}`)
      .then(({ data }) => {
        const imgElement = document.getElementById(`img${i}`);
        imgElement.src = data.data.projectImg; // 假设服务器返回的数据中包含图片URL
      })
      .catch((error) =>
        console.error(`Failed to load image for id ${i}: `, error)
      );
  }
});
